﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BuyTicket.aspx.cs" Inherits="TicketsOnline.BuyTicket" ValidateRequest="false"%>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<title>Buy ticket</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <h1>Buying tickets for event:</h1>
            <asp:ListView ID="ListViewSelectedEvent" runat="server">
                 <ItemTemplate>
                 <div>
                    <h3 class="eventTitle"><%# Eval("Title") %></h3>
                    <span class="catValue">Category:</span>  <%# System.Web.HttpUtility.HtmlEncode(Eval("Category.CategoryName")) %>  <br />
                    <span class="catValue">Date:</span>  <%# System.Web.HttpUtility.HtmlEncode(Eval("Date").ToString().Split(' ')[0]) %>  <br />
                    <span class="catValue">Price:</span>   $ <%# System.Web.HttpUtility.HtmlEncode(Eval("Price").ToString().Substring(0,Eval("Price").ToString().IndexOf('.'))) %>  <br />
                    <a class="buyTicketsLink" href="<%# "BuyTicket.aspx?event="+Eval("EventID") %>">Buy Tickets</a>
                 </div>
                 </ItemTemplate>
             </asp:ListView>

    <h1>Purchase information:</h1>
    <table>
    <tr>
        <td>Name:</td>
        <td><asp:TextBox runat="server" ID="NameBox"></asp:TextBox></td>
    </tr>
    <tr>
        <td>Address: </td>
        <td><asp:TextBox runat="server" ID="AddressBox"></asp:TextBox></td>
    </tr>
    <tr>
         <td>Amount:</td>
        <td> <asp:TextBox runat="server" ID="AmountBox"></asp:TextBox><br />
    </tr>
    <tr>
        <td colspan="2"><asp:Button runat="server" ID="SubmitButton" onclick="SubmitButton_Click" Text="Submit" /></td>
        <td>
    </tr>
    <asp:Label ID="ResultLabel" runat="server"></asp:Label>
    </table>
</asp:Content>
